import axios from '../axios'

/*
 * oem卡模块
 */

// 新增
export const save = (data) => {
  return axios({
    url: '/systemUser/saveUser',
    method: 'post',
    data
  })
}
// 剔除部门
export const eliminateDept = (params) => {
  return axios({
    url: '/systemUser/eliminateDept',
    method: 'GET',
    params
  })
}
//编辑
export const edit = (data) => {
  return axios({
    url: '/systemUser/updateUser',
    method: 'post',
    data
  })
}
//改密码
export const resetPwd = (params) => {
  return axios({
    url: '/systemUser/resetPwd',
    method: 'post',
    params
  })
}
// 分页查询
export const findPage = (params) => {
  return axios({
    url: '/systemUser/queryUserList',
    method: 'get',
    params
  })
}
//禁用启用
export const messageStatus = (params) => {
  return axios({
    url: '/systemUser/updateUserStatus',
    method: 'post',
    params
  })
}
// 根据类型查部门下的人员(学生)
export const findPageStudent = (params) => {
  return axios({
    url: '/systemUser/queryUserList?deptType=1',
    method: 'get',
    params
  })
}
// 根据类型查部门下的人员(学酷)
export const findPageXuecoo = (params) => {
  return axios({
    url: '/systemUser/queryUserList?deptType=2',
    method: 'get',
    params
  })
}
// 根据类型查部门下的人员(网校)
export const findPageChinaedu = (params) => {
  return axios({
    url: '/systemUser/queryUserList?deptType=3',
    method: 'get',
    params
  })
}
// 根据类型查部门下的人员(学校)
export const findPageSchool = (params) => {
  return axios({
    url: '/systemUser/queryUserList?deptType=4',
    method: 'get',
    params
  })
}
// 是否获取资源开关
export const updateIsContrlResource = (params) => {
  return axios({
    url: '/systemUser/updateIsContrlResource',
    method: 'post',
    params
  })
}

// ################前台用户相关接口##############
// 查询用户列表
export const findFontPage = (params) => {
  return axios({
    url: '/frontUserManager/pageList',
    method: 'get',
    params
  })
}
// 新增
export const saveFontInfo = (params) => {
  return axios({
    url: '/frontUserManager/saveInfo',
    method: 'post',
    params
  })
}
// 重置密码
export const resetFontPwd = (params) => {
  return axios({
    url: '/frontUserManager/resetPwd',
    method: 'post',
    params
  })
}
// 更新信息
export const editFontInfo = (params) => {
  return axios({
    url: '/frontUserManager/updateInfo',
    method: 'post',
    params
  })
}
// 停启用
export const updateFontStatus = (params) => {
  return axios({
    url: '/frontUserManager/updateStatus',
    method: 'post',
    params
  })
}
// 绑定大区经理
export const bindSystemUser = (params) => {
  return axios({
    url: '/frontUserManager/bindSystemUser',
    method: 'post',
    params
  })
}
// 绑定关联学校
export const bindFontSchool = (params) => {
  return axios({
    url: '/frontUserManager/bindSchool',
    method: 'post',
    params
  })
}
// 用户缓存列表
export const cacheFontList = (params) => {
  return axios({
    url: '/frontUserManager/cacheList',
    method: 'get',
    params
  })
}

// 绑定多个关联学校
export const bindFontSchools = (data) => {
  // console.log(params)
  return axios({
    url: '/frontUserManager/bindSchools',
    method: 'post',
    data
  })
}
// 刷新缓存

export const reloadUserCache = (params) => {
  return axios({
    url: '/systemUser/reloadUserCache',
    method: 'get',
    params
  })
}

// 配置资源权限

export const configResourceAuth = (data) => {
  return axios({
    url: '/systemUser/configResourceAuth',
    method: 'post',
    data
  })
}
// 获取资源权限
export const getConfigResourceAuth = (params) => {
  return axios({
    url: '/systemUser/getConfigResourceAuth',
    method: 'get',
    params
  })
}